package com.seven.good.dao;

import com.seven.good.pojo.Orders;
import org.apache.ibatis.annotations.Select;

public interface OrdersMapper {
    int deleteByPrimaryKey(Integer oid);

    int insert(Orders record);

    int insertSelective(Orders record);

    Orders selectByPrimaryKey(Integer oid);

    int updateByPrimaryKeySelective(Orders record);

    int updateByPrimaryKey(Orders record);

    @Select("select 1 from orders where uid=#{uid} and gid=#{gid} limit 1")
    int isHaveDepository(Integer uid,Integer gid);

    @Select("select 1 from orders where gid=#{gid} and state = 2")
    int isPaySuccessful(Integer gid);
    //根据用户id、商品id、支付成功状态1来查询是否交了保证金
    Orders selectIsRendBond(Integer gid,Integer uid);
}